import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import webrouter from "@/router/webrouter";
import LoginView from "@/views/web/LoginView";
import ManageLoginView from "@/views/manage/ManageLoginView.vue";
import ManageIndexView from "@/views/manage/ManageIndexView.vue";
import managerouter from "@/router/managerouter";
import LoginWithUsername from "@/views/web/LoginWithUsername";
import LoginWithPhone from "@/views/web/LoginWithPhone";
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'index',
    component: HomeView,
    children: [
        ...webrouter
    ]
  },
  {
    path:'/web/login',
    name:'login',
    component: LoginView,
    children: [
      {
        path:'/web/login',
        name:'loginByUsername',
        component: LoginWithUsername,
      },
      {
        path:'/web/loginByPhone',
        name:'loginByPhone',
        component:LoginWithPhone,
      }
    ]
  },

  {
    path:'/manage/login',
    name:'manageLogin',
    component: ManageLoginView,
  },
  {
    path:'/manage',
    name:'manage',
    component:ManageIndexView,
    children: [
        ...managerouter,
    ]
  },
  // {
  //   path: '/about',
  //   name: 'about',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  // }
]

const router = new VueRouter({
  routes
})

export default router
